<?php
    include('./config.php');
    include('./request.php');
    $user_id = $result->user_id;
    try{
        $pdo = new PDO($dsn,$user,$pass);
        $pdo->beginTransaction();
        $sql = "delete from user  where user_id=".$user_id;
        $res = $pdo->prepare($sql);
        $res->execute();
        if($res){
            echo "ok";
            $pdo->commit();
        }else{
            echo "error";
            $pdo->rollBack();
        }
    }catch(PDOException $e){
        $pdo->rollBack();
        echo "error";
    }
?>